package net.csdn.business.common.oauth2.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.common.domain.request.oauth.OauthAuthPermissionQuery;
import net.csdn.business.common.domain.vo.oauth.OauthAuthPermissionVO;
import net.csdn.business.common.oauth2.mapper.OauthAuthPermissionMapper;
import net.csdn.business.common.oauth2.model.entity.OauthAuthPermission;
import net.csdn.business.common.oauth2.service.IOauthAuthPermissionService;
import net.csdn.business.common.service.SuperServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * oauth权限Service业务层处理
 * 
 * @author zhangyl
 * @date 2022-11-21
 */
@Service
public class OauthAuthPermissionServiceImpl extends SuperServiceImpl<OauthAuthPermissionMapper, OauthAuthPermission> implements IOauthAuthPermissionService
{

    /**
     * 分页查询oauth权限列表
     *
     * @param query oauth权限
     * @return oauth权限
     */
    @Override
    public IPage<OauthAuthPermissionVO> findPageList(OauthAuthPermissionQuery query) {
        //获得Page对象
        Page<OauthAuthPermissionVO> page = query.getPage();
        List<OauthAuthPermissionVO> pageList=baseMapper.findPageList(page,query);
        page.setRecords(pageList);
        return page;
    }

    /**
     * 查询oauth权限列表
     * 
     * @param query oauth权限
     * @return oauth权限
     */
    @Override
    public List<OauthAuthPermissionVO> selectOauthAuthPermissionList(OauthAuthPermissionQuery query)
    {
        return baseMapper.selectOauthAuthPermissionList(query);
    }


    /**
     * 加载所有权限列表
     *
     * @return oauth权限
     */
    @Override
    public List<OauthAuthPermissionVO> selectOauthRoleList(OauthAuthPermissionQuery query)
    {
        return baseMapper.selectOauthRoleList(query);
    }
}
